package com.scheudler.demo;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//@Component
//@Configuration
//@EnableScheduling
public class SpringScheduled {

    @Scheduled(cron = "0/30 * * * * ?")
    private void refresh1(){
        System.out.println("每隔三十秒--获取微信token--"+System.currentTimeMillis());
    }

    @Scheduled(cron = "*/30 * * * * ?")
    private void refresh11(){
        System.out.println("0000每隔三十秒--获取微信token--"+System.currentTimeMillis());
    }

    @Scheduled(cron = "0 0 */1 * * ?")
    private void refresh2(){
        System.out.println("每隔一小时--获取微信token--"+System.currentTimeMillis());
    }
}
